<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserReceiveAddr extends Model
{
    protected $table="receive_addr";
    protected $primaryKey="receive_addr_id";
    protected $fillable=[
      'area','addr','name','phone','is_default','status','user_id','province','city'
    ];

    protected $hidden=[
      'province','city','area'
    ];

    public function province_name()
    {
        return $this->hasOne('App\Models\Province','provinceID','province');
    }


    public function city_name()
    {
        return $this->hasOne('App\Models\City','cityID','city');
    }


    public function area_name()
    {
        return $this->hasOne('App\Models\Area','areaID','area');
    }
}
